<?php
/**
 * @package     Joomla.Site
 * @subpackage  Templates.protostar
 *
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
// Getting params from template
$params = JFactory::getApplication()->getTemplate(true)->params;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;
// Detecting Active Variables
$option   = $app->input->getCmd('option', '');
$view     = $app->input->getCmd('view', '');
$layout   = $app->input->getCmd('layout', '');
$task     = $app->input->getCmd('task', '');
$itemid   = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');
if($task == "edit" || $layout == "form" ){$fullWidth = 1;}
else{$fullWidth = 0;}
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');
$doc->addScript('templates/' .$this->template. '/js/template.js');
// Add Stylesheets
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');
// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);
// Add current user information
$user = JFactory::getUser();
// Adjusting content width
if ($this->countModules('position-7') && $this->countModules('position-8')){$span = "span6";}
elseif ($this->countModules('position-7') && !$this->countModules('position-8')){$span = "span9";}
elseif (!$this->countModules('position-7') && $this->countModules('position-8')){$span = "span9";}
else{$span = "span12";}
// Logo file or site title param
if ($this->params->get('logoFile')){$logo = '<img src="'. JUri::root() . $this->params->get('logoFile') .'" title="'. $sitename .'" alt="'. $sitename .' | 5 Star Hotel in Ho Chi Minh (Saigon)" />';}
elseif ($this->params->get('sitetitle')){$logo = '<span class="site-title" title="'. $sitename .'">'. htmlspecialchars($this->params->get('sitetitle')) .'</span>';}
else{$logo = '<span class="site-title" title="'. $sitename .'">'. $sitename .'</span>';}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <?php
	function IsMobileBrowser(){
	   global $_SERVER;
	   if (isset($_SERVER['HTTP_X_WAP_PROFILE']))
		  return true;
	   if (isset($_SERVER['HTTP_ACCEPT'])){
		  $userAccept = strtolower($_SERVER['HTTP_ACCEPT']);
		  if (!(stristr($userAccept, 'wap')===FALSE))
			 return true;
	   }
	   $userBrowser = strtolower($_SERVER['HTTP_USER_AGENT']);
	   $mobiles = array(
		  "midp", "j2me", "avant", "docomo",
		  "novarra", "palmos", "palmsource",
		  "240x320", "opwv", "chtml",
		  "pda", "windows ce", "mmp/",
		  "blackberry", "mib/", "symbian",
		  "wireless", "nokia", "hand", "mobi",
		  "phone", "cdm", "up.b", "audio",
		  "SIE-", "SEC-", "samsung", "HTC",
		  "mot-", "mitsu", "sagem", "sony"
		  , "alcatel", "lg", "eric", "vx",
		  "NEC", "philips", "mmm", "xx",
		  "panasonic", "sharp", "wap", "sch",
		  "rover", "pocket", "benq", "java",
		  "pt", "pg", "vox", "amoi",
		  "bird", "compal", "kg", "voda",
		  "sany", "kdd", "dbt", "sendo",
		  "sgh", "gradi", "jb", "dddi",
		  "moto", "iphone"
	   );
	   foreach ($mobiles as $value){
		  if (!(stristr($userBrowser, $value)===FALSE)) return true;
	   }
	   return false;
	}
	if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
		if(IsMobileBrowser()){ // neu la mobile chuyen link qua mobile
		?>
			<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/protostar/css/mobile.css" type="text/css" />
		<?php
		}
	}
	else{
	?>
		<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/protostar/css/tablet.css" type="text/css" />
	<?php
	}
	?>
    <?php 
		  $exception_page = "Home";
		  $app = JFactory::getApplication();
		  if (trim($this->title)!=trim($exception_page)) {  
			   $new_page_title = $this->title . " - Windsor Plaza Hotel | Ho Chi Minh City (Saigon), Vietnam";  
			   $this->title = $new_page_title;  
		  } else { 
			   $this->title = trim($app->getCfg('sitename'));  
			 } 
	 ?>
	<jdoc:include type="head" />
	<?php
	if ($this->params->get('googleFont')){
	?>
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,700,300&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
		<style type="text/css">
			h1,h2,h3,h4,h5,h6,.site-title{
				font-family: '<?php echo str_replace('+', ' ', $this->params->get('googleFontName'));?>', sans-serif;
			}
		</style>
	<?php
	}
	?>
    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.easing.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.flexslider.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.carouFredSel.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/superfish.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/custom.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/protostar/js/jquery.slides.min.js"></script>
    <script>
    function getLocation(){
		var windowWidth = jQuery(window).width();//alert( windowWidth);
	}
    </script>
	<!--[if lt IE 9]><script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script><![endif]-->

</head>
<body onLoad="getLocation()" class="site <?php echo $option. ' view-' . $view. ($layout ? ' layout-' . $layout : ' no-layout'). ($task ? ' task-' . $task : ' no-task')
	. ($itemid ? ' itemid-' . $itemid : ''). ($params->get('fluidContainer') ? ' fluid' : '');?>">
<!-- Body -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-WHSVKZ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WHSVKZ');</script>
<div class="body">
	<div id="top-bar">
    	<div class="container">
            <jdoc:include type="modules" name="position-2" style="none" />
            <jdoc:include type="modules" name="position-3" style="none" />
        </div>
    </div>
    <div id="header" class="clearfix">
        <div class="container">
            <div id="logo"> 
            	<jdoc:include type="modules" name="position-8" style="none"/>
            </div>
            <div class="navigation menutop" id="primary-menu">
				<?php
                if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
                    if(IsMobileBrowser()){?><a class="getdisrections" href="http://windsorplazahotel.com/wphnew/mobile_app/"></a><jdoc:include type="modules" name="menumobile" style="none" /><?php }
					else{?><jdoc:include type="modules" name="position-1" style="none" /><jdoc:include type="modules" name="menumobile" style="none" /><?php }
                }
                else{?><jdoc:include type="modules" name="position-1" style="none" /><jdoc:include type="modules" name="menumobile" style="none" /><?php }?>
            </div>
        </div>
    </div>
    <div class="clearfix" id="content">
    	<div class="container">
            <div class="bannerandbooking">
                <jdoc:include type="modules" name="banner" style="xhtml" />
                
                <?php
                if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
                    if(IsMobileBrowser()){?><a class="getdisrections" href="http://windsorplazahotel.com/wphnew/mobile_app/"></a><jdoc:include type="modules" name="position-5mobile" style="none" /><?php }
					else{?><jdoc:include type="modules" name="position-5" style="none" /><?php }
                }
                else{?><jdoc:include type="modules" name="position-5" style="none" /><?php }?>
            </div>
            <jdoc:include type="modules" name="breadcrumbs" style="none" />
        	<?php
            if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') == false){
				if(IsMobileBrowser()){
				?>
                    <div class="mainhome">
                        <!--<jdoc:include type="message" />-->
                        <jdoc:include type="component" />
                        <?php if ($this->countModules('highlights') || $this->countModules('position-7')) : ?>
                            <jdoc:include type="modules" name="position-7" style="none" />
                        <?php endif; ?>
                        <?php if ($this->countModules('other-article') && $option == 'com_content' && $view == 'article') : ?>
                            <div class="other-article">
                                <jdoc:include type="modules" name="other-article" style="well" />
                            </div>
                        <?php endif; ?>
                    </div>
                    <jdoc:include type="modules" name="position-6" style="none" />
                    <jdoc:include type="modules" name="highlights" style="none" />
                <?php	
				}
				else{
				?>
                    <jdoc:include type="modules" name="position-6" style="none" />
                    
                    <div class="mainhome">
                        <!--<jdoc:include type="message" />-->
                        <jdoc:include type="component" />
                        <?php if ($this->countModules('highlights') || $this->countModules('position-7')) : ?>
                            <jdoc:include type="modules" name="position-7" style="none" />
                            <jdoc:include type="modules" name="highlights" style="none" />
                        <?php endif; ?>
                        <?php if ($this->countModules('other-article') && $option == 'com_content' && $view == 'article') : ?>
                            <div class="other-article">
                                <jdoc:include type="modules" name="other-article" style="well"/>
                            </div>
                        <?php endif; ?>
                    </div>
                <?php
				}
			}
			else{
			?>
                <jdoc:include type="modules" name="position-6" style="none" />
                
                <div class="mainhome">
                    <!--<jdoc:include type="message" />-->
                    <jdoc:include type="component" />
                    <?php if ($this->countModules('highlights') || $this->countModules('position-7')) : ?>
                        <jdoc:include type="modules" name="position-7" style="none" />
                        <jdoc:include type="modules" name="highlights" style="none" />
                    <?php endif; ?>

                    <?php if ($this->countModules('other-article') && $option == 'com_content' && $view == 'article') : ?>
                        <div class="other-article">
                            <jdoc:include type="modules" name="other-article" style="well"/>
                        </div>
                    <?php endif; ?>
                </div>
        	<?php
			}
			?>
        </div>
    </div>
	<div class="bottompage">
		<div class="container">
			<!-- Footer top -->
            <div class="footer" id="footer">
            	<div class="footerfooter">
					<?php if ($this->countModules('position-9')):?>
                    <div class="bottomleft" class="event-venue" itemprop="location" itemscope itemtype="http://schema.org/Place">
                        <jdoc:include type="modules" name="position-9" style="well" />
                    </div>
                    <?php endif; ?>
                    <?php if ($this->countModules('position-10')):?>
                    <div class="bottomcenter">
                        <jdoc:include type="modules" name="position-10" style="well" />
                        <script src="http://www.jscache.com/wejs?wtype=certificateOfExcellence&amp;uniq=295&amp;locationId=505784&amp;lang=en_US&amp;year=2014"></script>
                    </div>
                    <?php endif; ?>
                    <?php if ($this->countModules('position-11')):?>
                    <div class="bottomright">
                        <jdoc:include type="modules" name="position-11" style="well" />
                    </div>
                    <?php endif; ?>
            	</div>
            </div>
            
            <div class="menubottom">
            	<div class="footerfooter">
                    <div class="bottommenu">
                        <jdoc:include type="modules" name="footermenu" style="none" />
                    </div>
                    <div class="copyrights">
                        <p>&copy; <?php echo date('Y');?> Windsor Plaza Hotel</p>
                    </div>
                    <div class="logobottomright">
                        <a href="http://wmcvietnam.com" target="_blank">
                        <img alt="Windsor Plaza Hotel | Ho Chi Minh City (Saigon), Vietnam" src="<?php echo $this->baseurl ?>/images/banners/logo/logo_wmcbottom.png" />
                        </a>
                    </div>
            	</div>
            </div>
		</div>
	</div
    
    
></div>

<jdoc:include type="modules" name="debug" style="none" />
</body>
</html>
